Fix ShallowWaterExnerEquations1D for negative / zero velocities#101
Merged
andrewwinters5000 merged 6 commits intotrixi-framework:mainfrom May 15, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
=======================================
Coverage 99.19% 99.19%
=======================================
Files 72 73 +1
Lines 3449 3459 +10
=======================================
+ Hits 3421 3431 +10
Misses 28 28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes some bugs that occur when
ShallowWaterExnerEquations1Dare applied for test cases with negative or zero velocities. Theses errors were not covered by the current test setup, so I also added a new elixirelixir_shallowwater_exner_dam_break_symmetricto cover these cases.There were two bugs present:
h_swe introduce a conditionv<eps()to introduce a special treatment for zero velocities. This was changed toabs(v) < eps()to not apply this for negative velocities.h_s_avgin thedissipation_roewas changed to avoid division by zero velocities.In addition to that I also updated the representation of some constants to be compatible with single precision and introduced a type conversion to the constructor of the sediment models.